<?php
namespace Events\Form;

use Zend\Form\Form;

class EventForm extends Form
{

    public function __construct($name = null)
    {
        parent::__construct('register');
        $this->setAttribute('method', 'post');
        $this->setAttribute('class', 'form-horizontal');
        $this->setInputFilter(new EventFormFilter());
        
        $this->add(array(
            'name' => 'ID',
            'type' => 'Hidden',
            array(
                'default' => '2'
                )
        ));
        
        $this->add(array(
            'name' => 'TITLE',
            'options' => array(
                'label' => 'Title'
            ),
            'type' => 'Text',
            'attributes' => array(
                'class' => 'form-control'
            )
        ));
        
        $this->add(array(

            'name' => 'DATE',
            'type' => 'text',
            'options' => array(
                'label' => 'Event Date',
                'format' => 'Y-m-d'
            ),
            'attributes' => array(
                'class' => 'form-control',
                'id' => 'event_date'                
            )

        ));
        
/*         $this->add(array(
            'name' => 'SESSIONS',
            'options' => array(
                'label' => 'Sessions',
                'empty_option' => '--select an event--',
                'disable_inarray_validator' => true
            ),
            'type' => 'Select',
            'attributes' => array(
                'class' => 'form-control',
                'style' => 'width:15em'
            )
        )); */
        
        $this->add(array(
            'name' => 'SUBJECT',
            'options' => array(
                'label' => 'Subject'
            ),
            'type' => 'Text',
            'attributes' => array(
                'class' => 'form-control'
            )
        ));
        
        $this->add(array(
            'name' => 'DESCRIPTION',
            'options' => array(
                'label' => 'Description ',
        
            ),
            'type' => 'Textarea',
            'attributes' => array(
                'class' => 'form-control',
                'style' => 'resize: none'
            )
        ));
        
        $this->add(array(
            'name' => 'PLACE',
            'options' => array(
                'label' => 'Place'
            ),
            'type' => 'Text',
            'attributes' => array(
                'class' => 'form-control',
                'id' =>'geocomplete'
            )
        ));
        
        $this->add(array(
            'name' => 'CATEGORY',
            'options' => array(
                'label' => 'Category'
            ),
            'type' => 'Select',
            'attributes' => array(
                'class' => 'form-control',
                'style' => 'width:15em',
                'options' => array(
                    '0' => '--select--',
                    '1' => 'Main',
                    '2' => 'District',
                    '3' => 'Regional'
                )
            )
        ));
        
        $this->add(array(
            'name' => 'EVENT_STATUS',
            'options' => array(
                'label' => 'Event Status'
            ),
            'type' => 'Select',
            'attributes' => array(
                'class' => 'form-control',
                'style' => 'width:15em',
                'options' => array(
                    '0' => '--select--',
                    '1' => 'Pending',
                    '2' => 'Completed'
                )
            )
        ));
        
        $this->add(array(
            'name' => 'SEATS',
            'options' => array(
                'label' => 'Seats'
            ),
            'type' => 'Text',
            'attributes' => array(
                'class' => 'form-control',
                'style' => 'width:120px'
            )
        ));
        
        $this->add(array(
            'name' => 'BTNSAVE',
            'options' => array(
                'label' => ''
            ),
            'attributes' => array(
                'value' => 'Save',
                'class' => 'btn btn-default'
            ),
            'type' => 'submit',
            'id' => 'submitbutton'
        ));
        
        $this->add(array(
            'name' => 'BTNCLEAR',
            'options' => array(
                'label' => ''
            ),
            'attributes' => array(
                'value' => 'Clear',
                'class' => 'btn btn-default'
            ),
            'type' => 'submit',
            'id' => 'submitbutton'
        ));
        
        // We could also define the input filter here, or
        // lazy-create it in the getInputFilter() method.
    }
}